package it.rockliveitalia.entity;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Event {

	private String id;
	private String venueName;
	private String venueSite;
	private Date date;
	private String street;
	private String city;
	private String provincia;
	private String band;
	private String bandSite;
	private String description;
	private String image;
	private String tag;
	private String lat;
	private String lng;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getVenueName() {
		return venueName;
	}

	public void setVenueName(String venueName) {
		this.venueName = venueName;
	}

	public Date getDate() {
		return date;
	}

	public String getStringDate() {
		Calendar c = GregorianCalendar.getInstance();
		c.setTime(date);
		return c.get(Calendar.DATE) + "/" + (c.get(Calendar.MONTH) + 1) + "/"
				+ c.get(Calendar.YEAR);
	}

	public void setDate(String date) {
		try {
			int i = 0;
			int temp = 0;
			i = date.indexOf("/", i + 1);
			int day = Integer.parseInt(date.substring(temp, i));
			temp = i + 1;
			i = date.indexOf("/", i + 1);
			int month = Integer.parseInt(date.substring(temp, i));
			temp = i + 1;
			int year = Integer.parseInt(date.substring(temp));
			Calendar c = Calendar.getInstance();
			c.set(Calendar.YEAR, year);
			c.set(Calendar.MONTH, month - 1);
			c.set(Calendar.DATE, day);
			this.date = c.getTime();
		} catch (StringIndexOutOfBoundsException e) {
			e.printStackTrace();
			Calendar c = Calendar.getInstance();
			c.set(Calendar.YEAR, 1971);
			this.date = c.getTime();
		}

	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getProvincia() {
		return provincia;
	}

	public void setProvincia(String provincia) {
		this.provincia = provincia;
	}

	public String getVenueSite() {
		return venueSite;
	}

	public void setVenueSite(String venueSite) {
		this.venueSite = venueSite;
	}

	public String getBand() {
		return band;
	}

	public void setBand(String band) {
		this.band = band;
	}

	public String getBandSite() {
		return bandSite;
	}

	public void setBandSite(String bandSite) {
		this.bandSite = bandSite;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	public String getLng() {
		return lng;
	}

	public void setLng(String lng) {
		this.lng = lng;
	}

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

}
